package com.tengju.user.domain.model.csa;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum GenSecCustomerServiceWorkTypeEnum {
    //客服工作类型枚举
    WORK_DAY(1,"工作日");

    private int type;
    private String msg;

    GenSecCustomerServiceWorkTypeEnum(int type, String msg) {
        this.type = type;
        this.msg = msg;
    }

    public static GenSecCustomerServiceWorkTypeEnum form(Integer type) {
        if (Objects.isNull(type)) {
            return WORK_DAY;
        }
        for (GenSecCustomerServiceWorkTypeEnum typeEnum : GenSecCustomerServiceWorkTypeEnum.values()) {
            if (typeEnum.getType() == type) {
                return typeEnum;
            }
        }
        return WORK_DAY;
    }
}
